package com.groupbuying.orderproducer.connector;

import com.groupbuying.orderproducer.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @Author gxy
 * @Description 调用系统配置中心
 * @Date 2019/4/11 16:12
 **/

@Service
@FeignClient("service-sysconfig")
public interface SysConfigFeign {
    @RequestMapping(value = "/keyinfo/list", method = RequestMethod.GET)
    Result getOrderKindList(@RequestParam Map<String, Object> params);

    // 订单中心-订单id
    @RequestMapping(value = "/common/order/getOrderId", method = RequestMethod.GET)
    String getOrderID(@RequestParam("cityCode") String cityCode,@RequestParam("bizTag") String bizCode);

    // 商品子订单中心-订单id
    @RequestMapping(value = "/common/commodity/getSuborderId", method = RequestMethod.GET)
    String getSuborderId(@RequestParam("cityCode") String cityCode,@RequestParam("bizTag") String bizCode);
    /**
     * 获取商户积分规则
     * */
    @RequestMapping(value = "/opexRule/getRule", method = RequestMethod.GET)
    Map getStoreOpexRule(@RequestParam Map<String, Object> params);

    /**
     * 通过中心编码获取该中心的功能开放规则
     * @param centerCode
     * @return
     */
    @GetMapping("/functionControl/getUrlByCenterCode")
    List<String> getUrlByCenterCode(@RequestParam("centerCode") String centerCode);
}
